﻿<Window x:Class="Wintellect.LiveFx.Cloudboard.ClipboardRing"
        x:Name="window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:win="clr-namespace:Wintellect.LiveFx.Cloudboard"
        Visibility="Collapsed"
        ShowInTaskbar="True"
        Title="Wintellect Cloudboard"
        Icon="/Cloudboard;component/Resources/Clipboard.ico" 
        Height="300" 
        Width="500"
        WindowStyle="SingleBorderWindow"
        Topmost="True"
        WindowStartupLocation="CenterScreen">
  <Window.InputBindings>
    <KeyBinding Key="Enter"
              Command="{x:Static win:ClipboardRing.PasteSelectedItem}" />
    <KeyBinding Key="Delete"
              Command="ApplicationCommands.Delete" />
    <KeyBinding Key="Escape"
              Modifiers="Control" 
              Command="ApplicationCommands.Close" />
  </Window.InputBindings>
  <Window.CommandBindings>
    <CommandBinding Command="ApplicationCommands.Close"
                  Executed="CloseCommandExecuted"/>
    <CommandBinding Command="ApplicationCommands.Delete"
                  Executed="DeleteCommandExecuted"
                  CanExecute="DeleteCommandCanExecute" />
    <CommandBinding Command="ApplicationCommands.Copy"
                  Executed="CopyCommandExecuted"
                  CanExecute="CopyCommandCanExecute" />
    <CommandBinding Command="ApplicationCommands.Paste"
                  Executed="PasteCommandExecuted"/>
    <CommandBinding Command="{x:Static win:ClipboardRing.AddItemFromClipboard}"
                  Executed="AddItemCommandExecuted"
                  CanExecute="AddItemCommandCanExecute" />
    <CommandBinding Command="{x:Static win:ClipboardRing.PasteSelectedItem}"
                  Executed="PasteCurrentItemCommandExecuted"
                  CanExecute="PasteCurrentItemCommandCanExecute" />
  </Window.CommandBindings>

  <Window.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Resources\GlassButton.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      <LinearGradientBrush x:Key="MainBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFFFFFF" Offset="0"/>
        <GradientStop Color="#FF111111" Offset=".5"/>
        <GradientStop Color="#FFFFFFFF" Offset="1"/>
      </LinearGradientBrush>
      <Storyboard x:Key="FadeInAnimation">
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:01.0000000" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(FrameworkElement.Opacity)">
          <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
          <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
      </Storyboard>
    </ResourceDictionary>
  </Window.Resources>
  <Window.Background>
    <Binding Source="{StaticResource MainBackground}"/>
  </Window.Background>
  <Grid x:Name="layout" Focusable="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
    <win:BusyIndicator x:Name="busyIndicator" FocusVisualStyle="{x:Null}" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
    <win:ItemCarousel x:Name="Items" FocusVisualStyle="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
    <win:Hyperlink HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="8" Click="ManagePermissions_Click">Manage Permissions</win:Hyperlink>
    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="4" Orientation="Horizontal">
      <Button 
        Style="{StaticResource GlassButton}" Width="40" Height="40" Background="Black" Margin="4" 
        ToolTip="Rotate Left"
        Command="{x:Static win:ItemCarousel.RotateLeft}" CommandTarget="{Binding ElementName=Items}">
        <Image Width="32" Height="32" Source="Resources\LeftArrow.png"/>
      </Button>
      <Button 
        Style="{StaticResource GlassButton}" Width="40" Height="40" Background="Black" Margin="4" 
        ToolTip="Add a new item from the Windows clipboard"
        Command="{x:Static win:ClipboardRing.AddItemFromClipboard}">
        <Image Width="32" Height="32" Source="Resources\CopyButton.png"/>
      </Button>
      <Button 
        Style="{StaticResource GlassButton}" Width="40" Height="40" Background="Black" Margin="4" 
        ToolTip="Push this item into the Windows clipboard"
        Command="{x:Static win:ClipboardRing.PasteSelectedItem}">
        <Image Width="32" Height="32" Source="Resources\PasteButton.png"/>
      </Button>
      <Button 
        Style="{StaticResource GlassButton}" Width="40" Height="40" Background="Black" Margin="4" 
        ToolTip="Rotate Right"
        Command="{x:Static win:ItemCarousel.RotateRight}" CommandTarget="{Binding ElementName=Items}">
        <Image Width="32" Height="32" Source="Resources\RightArrow.png"/>
      </Button>
    </StackPanel>
  </Grid>
</Window>
